package com.rimi.project.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.rimi.project.bean.UserCard;
import com.rimi.project.dao.UserCardDao;
import com.rimi.project.dao.impl.UserCardDaoImpl;

@WebServlet("/park/parklist")
public class ParkingListServlet extends HttpServlet{
	private UserCardDao userCardDao = new UserCardDaoImpl();
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
		// 查询所有图书
		List<UserCard> cards = userCardDao.getAllCard();
		
		// 将图书放到request作用域
		req.setAttribute("cards", cards);
		
		req.getRequestDispatcher("/usermanage.jsp").forward(req, resp);
	}
}
